package GUI;

import javax.swing.*;
import java.awt.*;

public class Wb extends JFrame{
    JLabel label;
    public Wb(String title){
        super(title);

        Container container =getContentPane();
        JPanel panel = new JPanel();
        container.add(panel,BorderLayout.NORTH);
        label = new JLabel("文本框");
        JLabel label1 = new JLabel("密码框");
        JLabel label2 = new JLabel("文本区");
        JTextField field = new JTextField("文本框");
        JPasswordField jPasswordField = new JPasswordField("密码框");
        JTextArea area = new JTextArea("文本区",3,4);
        panel.add(label);
        panel.add(field);
        panel.add(label1);
        panel.add(jPasswordField);
        JPanel jPanel = new JPanel();
        container.add(jPanel,BorderLayout.CENTER);
        jPanel.add(label2);
        jPanel.add(area);






        setSize(300,300);
        setVisible(true);
        field.addActionListener((e -> {
            area.setText("文本框按下enter");
        }));

    }
}
